<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
    <script src="./node_modules/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      {{msg}}
      <!-- <input type="text" @input="handleInput" :value="msg" /> -->
      <input type="text" v-model="msg" />
    </div>
    <script>
      // v-model 是一个语法糖
      // view -> data
      // data -> view
      // 双向绑定

      // vue -> 单向绑定
      const app = new Vue({
        el: "#app",
        data: {
          msg: "hello world",
        },
        // methods: {
        //   handleInput(e) {
        //     console.log(e.target.value);
        //     this.msg = e.target.value;
        //   },
        // },
      });

      console.log(app);
    </script>
  </body>
</html>
